package com.hanamaki.WebDriverTest;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class ChromeDriverTest {

    public static void main(String[] args) {

        //注册本地谷歌打开的位置
        System.setProperty("webdriver.chrome.driver",
                "C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe");

        //注册驱动
        WebDriver driver;

        //初始化
        driver = new ChromeDriver();

        driver.get("https://www.baidu.com");

        // 点击看奥运
        WebElement element = driver.findElement(By.xpath("//*[@id=\"lm-new\"]/a"));
        element.click();

    }
}
